window.addEventListener('DOMContentLoaded', function () {
    const a = document.querySelectorAll('.block-nav .nav-center a')
    const b = document.querySelectorAll('.none-nav .nav-center a')

    function show(e) {
        for (let i = 0; i < e.length; i++) {
            e[i].addEventListener('click', function () {
                localStorage.setItem('name', i)
                location.href = '../index.html'
            })
        }
    }
    // 在本地存储点击导航栏对应的下标并跳转到首页
    show(a)
    show(b)
})